/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thienphuc.patient.dao.impl;

import java.util.List;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import thienphuc.patient.dao.AbstractHibernateDaoSupport;
import thienphuc.patient.dao.PhongBanDAO;
import thienphuc.patient.dto.PhongBan;

/**
 *
 * @author QuocDat
 */
public class PhongBanDAOImpl extends AbstractHibernateDaoSupport<PhongBan, Integer> implements PhongBanDAO {

    public PhongBanDAOImpl(Class<PhongBan> classPersistent) {
        super(classPersistent);
    }

    public List<PhongBan> findByTenPhongBan(String tenPhongBan) {
        Criterion criterionTenPhongBan = Restrictions.like(PHONG_BAN_TEN_PHONG, "%" +tenPhongBan + "%");
        return this.findByCriteria(criterionTenPhongBan);
    }

    public List<PhongBan> findByTrangThai(boolean trangThai) {
        return this.findByProperty(PHONG_BAN_TRANG_THAI, trangThai);
    }
    
}
